package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.UserDao;

public class UpdateUserInfo extends HttpServlet {
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException{
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=UTF-8");
		
		String hobbies = request.getParameter("hobbies");
		String birthday = request.getParameter("birthday");
		String description = request.getParameter("descrption");
		String username = (String)request.getSession().getAttribute("loginFlg");
		
		new UserDao().update(hobbies, birthday, description,username);
		response.sendRedirect("./showDetail");
		
	}

}
